import {axiosClient,HttpPromise} from '../../utils/axiosClient';
import { HotMovieReq, MovieRespData, SwiperData } from '../bean/ApiTypes';
import { DetailMvResp } from '../bean/DetailMvResp';
import { MvSourceResp } from '../bean/MvSourceResp';
import { PiaoFangResp } from '../bean/PiaoFangResp';
import { SearchResp } from '../bean/SearchResp';


// 1.获取轮播图接口
export const getSwiperData = (): HttpPromise<SwiperData> => axiosClient.get({url:'/swiperdata'});

// 2.获取即将上映影视接口
export const getSoonMovie = (start:number,count:number): HttpPromise<MovieRespData> => axiosClient.post({url:'/soonmovie',data: { start:start,count:count }});

// 3.获取热门影视接口
export const getHotMovie = (req:HotMovieReq): HttpPromise<MovieRespData> => axiosClient.post({url:'/hotmovie',data:req});

// 4.获取最新上演影视接口
export const getNewMovie =  (start:number,count:number): HttpPromise<MovieRespData> => axiosClient.post({url:'/newmovie',data: { start:start,count:count }});

// 5.获取最热门剧集接口
export const getHotTv =  (start:number,count:number): HttpPromise<MovieRespData> => axiosClient.post({url:'/tvhot',data: { start:start,count:count }});

// 6.获取北美票房榜接口
export const getUsHotMv =  (start:number,count:number): HttpPromise<MovieRespData> => axiosClient.post({url:'/usmovie',data: { start:start,count:count }});

// 6.获取电影详情接口
export const getDetailMv =  (id:string): HttpPromise<DetailMvResp> => axiosClient.post({url:'/detailmovie',data: { id:id }});

// 7.电影搜索接口
export const movieSearch =  (q:string,start:number,count:number): HttpPromise<SearchResp> => axiosClient.post({url:'/searchmovie',data: {  q:q,start:start,count:count }});

// 8.电影票房接口
export const getPiaoMovie =  (): HttpPromise<PiaoFangResp> => axiosClient.get({url:'/piaomovie'});

// 9.电影资源接口
export const getMovieSrc =  (id:string): HttpPromise<MvSourceResp> => axiosClient.get({url:'/mvsource/'+id});

// 10.获取电影排行榜接口
export const getMvTop250 =  (start:number,count:number): HttpPromise<MovieRespData> => axiosClient.post({url:'/topmovie',data: { start:start,count:count }});

